﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DevFx.FrameWork.Pager
{
    /// <summary>
    /// 查询条件对象
    /// </summary>
    [Serializable]
    public abstract class SearchCondition
    {
        #region 构造函数



        /// <summary>
        /// 构造函数
        /// </summary>
        protected SearchCondition()
        {

        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="conditionName">查询条件</param>
        /// <param name="conditionValue">条件值</param>
        public SearchCondition(string conditionName, string conditionValue)
            : this(conditionName, conditionValue, SearchMode.Contain)
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="conditionName">查询条件</param>
        /// <param name="conditionValue">条件值</param>
        /// <param name="mode">查询条件模式</param>
        public SearchCondition(string conditionName, string conditionValue, SearchMode mode)
        {
            this.ConditionName = conditionName;
            this.ConditionValue = conditionValue;
            this.SearchMode = mode;
        }

        #endregion

        #region 公共属性



        /// <summary>
        /// 查询条件名
        /// </summary>
        public string ConditionName
        {
            get;
            protected set;
        }

        /// <summary>
        /// 查询条件值
        /// </summary>
        public string ConditionValue
        {
            get;
            protected set;
        }

        /// <summary>
        /// 查询方式
        /// </summary>
        public SearchMode SearchMode
        {
            get;
            protected set;
        }

        #endregion


    }
}
